// 视图组件
const view = {
  tabs: () => import('@/layouts/tabs'),
  blank: () => import('@/layouts/BlankView'),
  page: () => import('@/layouts/PageView')
}

// 路由组件注册
const routerMap = {
  loading: {
    path: '/loading',
    component: () => import('@/pages/loading')
  },
  login: {
    authority: '*',
    path: '/login',
    component: () => import('@/pages/login')
  },
  exp403: {
    authority: '*',
    name: 'exp403',
    path: '403',
    component: () => import('@/pages/exception/403')
  },
  exp404: {
    name: 'exp404',
    path: '404',
    component: () => import('@/pages/exception/404')
  },
  exp500: {
    name: 'exp500',
    path: '500',
    component: () => import('@/pages/exception/500')
  },
  root: {
    path: '/',
    name: '首页',
    redirect: '/loading',
    component: view.tabs
  },
  home: {
    name: '首页',
    component: view.blank
  },
  workplace: {
    name: '工作台',
    component: () => import('@/pages/dashboard/workplace')
  },
  analysis: {
    name: '分析页',
    component: () => import('@/pages/dashboard/analysis')
  },
  plugin: {
    name: '插件管理',
    icon: 'icon:dashboard',
    component: () => import('@/pages/plugin')
  },
  plugin_detail: {
    name: '插件详情',
    icon: 'icon:form',
    invisible: 'true',
    component: () => import('@/pages/plugin/Detail.vue')
  },
  menu: {
    name: '菜单管理',
    icon: 'warning',
    component: () => import('@/pages/menu')
  },
  none: {
    name: '未设置菜单名称',
    component: view.page
  },
  iframe: {
    name: '插件容器',
    component: () => import('@/plugin/iframe')
  },
  add: {
    name: '新增',
    component: () => import('@/pages/dashboard/workplace')
  }
}
export default routerMap
